﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using rkShared;

namespace rkClient
{
	public partial class JoinGame : Form
	{
		
		static public Color playerColor;

		public JoinGame()
		{
			InitializeComponent();
			playerColor = Color.Blue;
			pictureBox1.BackColor = Color.Blue;
			colorDialog1.Color = Color.Blue;
			
			
		}

		private void textBox1_TextChanged(object sender, EventArgs e)
		{

		}

		private void button1_Click(object sender, EventArgs e)
		{
			colorDialog1.ShowDialog();
			
			playerColor = colorDialog1.Color;
			pictureBox1.BackColor = colorDialog1.Color;
		}

        private void btnJoinGame_Click(object sender, EventArgs e)
        {
            AppGlobals.ServerIP = txtIP.Text;
            AppGlobals.Color = new Vector3((float)(playerColor.R) / 255.0f, 
                (float)(playerColor.G) / 255.0f, 
                (float)(playerColor.B) / 255.0f);
            AppGlobals.PlayerName = txtPlayerName.Text;

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
	}
}
